package org.vectrics.j2ee.realm;

import org.vectrics.j2ee.realm.DuplicateAccountException;
import javax.servlet.http.HttpSession;
import javax.servlet.ServletContext;
//import javax.ejb.SessionContext;

/**
 * This interface is implemented by a class that contains
 * non-portable security code.
 */
public interface SecurityAdapter {

   /**
   * This method adds a user with the specified password to
   * the specified group within a realm.
   *
   * @throws  DupplicateAccountException if the userName
   *          already exists
   */
   //public void addUser(String realmName, String group, String userName, String password, SessionContext sc) throws DuplicateAccountException;
   public void addUser(String realmName, String group, String userName, String password) throws DuplicateAccountException;
   /**
   * Programatically Logs a user into the form based login
   * mechamism of a web server when a new account is created.
   * This prevents the user from having to log in after
   * a new account is created.
   */
   public boolean loginUser(String userName, String password, ServletContext context, HttpSession session);
}
